package com.example.controller;

import com.example.entity.RegionStats;
import com.example.service.ConfirmedService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author junqiancai@foxmail.com
 * @since 2021/5/15 23:32
 */
@RestController
public class ConfirmedController {
    @Resource
    private ConfirmedService service;

    //获取某个state的确诊情况
    @GetMapping("/getStateConfirmed")
    public RegionStats getStateConfirmed(@RequestParam("stateName") String stateName){
        return service.getStateConfirmed(stateName);
    }

    //获取某个country的确诊情况
    @GetMapping("/getCountryConfirmed")
    public RegionStats getCountryConfirmed(@RequestParam("countryName") String countryName){
        return service.getCountryConfirmed(countryName);
    }

    //获取全球的确认情况
    @GetMapping("/getGlobalConfirmed")
    public RegionStats getGlobalConfirmed(){
        return service.getGlobalConfirmed();
    }
}
